﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ComputerResourceConsole.lib;
using ComputerResourceConsole.common;
using ComputerResourceConsole.factory;
using ComputerResourceConsole.control;
using System.IO;

public class PackingControl : ComponentControl, IPackingControl
{
    private IPackingOpera _pPackingOpera = null;

    public PackingControl(): base()
    {
        this._pPackingOpera = ComponentOperaFactory.createPackingOpera();
        this._pPackingOpera.FilePath = this._pConfig.NodejsPath;
    }

    public int start(CommonMethod.CommonEvent exit)
    {
        this._status = "Started";
        return this._pPackingOpera.start(exit);
    }

    public int stop()
    {
        this._status = "Stopped";
        return this._pPackingOpera.stop();
    }

    public int restart(CommonMethod.CommonEvent exit)
    {
        this._pPackingOpera.stop();
        int flag = this._pPackingOpera.start(exit);
        this._status = "Started";
        return flag;
    }

    public string ConfigPath
    {
        get
        {
            return this._pPackingOpera.ConfigPath;
        }
        set
        {
            this._pPackingOpera.ConfigPath = value;
        }
    }
}